home *** CD-ROM | disk | FTP | other *** search
- Path: fet.tiasur.tomsk.su!Orchid!leha
- From: leha@Orchid.fet.tiasur.tomsk.su (Dirks Alexey)
- Newsgroups: comp.lang.c++
- Subject: Re: Array of Funcions ??
- Date: 14 Apr 96 09:02:36 GMT
- Organization: TASUR
- Message-ID: <leha.829472556@Orchid>
- References: <4kgr2c$b99@news.dpi.udec.cl>
- NNTP-Posting-Host: orchid.fet.tiasur.tomsk.su
-
- tarmstro@caleuche.inf.UDEC.CL (Thomas Armstrong Kobrich) writes:
-
- > I've the following problem. I Want to define an array
- >of functions (all with the same return value an the same parameters,
- >of course), named FuncArray, but I'dont know how to do it.
- > The sentence:
-
- I test this, and find it works:
-
- #include <stdio.h>
- static void (*Func[2])(void);
- void func1()
- {
- puts("func 1");
- }
- void func2()
- {
- puts("func 2");
- }
- int main()
- {
- int i;
- Func[0] = func1;
- Func[1] = func2;
- for( i=0; i<2; i++ )
- {
- Func[i]();
- }
- }
-